package com.westos.userauth.dao.impl;

import com.westos.userauth.dao.SecurityGroupPermissionDao;
import com.westos.userauth.dao.mybatis.SecurityGroupPermissionDAO;
import com.westos.userauth.domain.SecurityGroupPermission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class MybatisSecurityGroupPermissionDao implements SecurityGroupPermissionDao {
    @Autowired
    private SecurityGroupPermissionDAO securityGroupPermissionDAO;

    @Override//方政
    public List<SecurityGroupPermission> querySecurityGroupPermissionById(String permissionId, String groupId) {
        return securityGroupPermissionDAO.querySecurityGroupPermissionById(permissionId,groupId);
    }

    @Override//方政
    public List<SecurityGroupPermission> querySecurityGroupPermissionByLoginId(String loginId, String permissionId) {
        return securityGroupPermissionDAO.querySecurityGroupPermissionByLoginId(loginId, permissionId);
    }

    @Override //王实
    public int deleteSecurityGroupPermission(List<String> list, String groupId) {
        return securityGroupPermissionDAO.deleteSecurityGroupPermission(list,groupId);
    }

    @Override //王实
    public List<SecurityGroupPermission> querySecurityGroupPermission(String groupId) {
        return securityGroupPermissionDAO.querySecurityGroupPermissionByID(groupId);
    }

    @Override
    public int addSecurityPermissionToSecurityGroup(SecurityGroupPermission securityGroupPermission) {
        return securityGroupPermissionDAO.addSecurityPermissionToSecurityGroup(securityGroupPermission);
    }

    @Override
    public SecurityGroupPermission querySecurityGroupPermission(String permissionId, String groupId) {
        return securityGroupPermissionDAO.querySecurityGroupPermission(permissionId,groupId);
    }

    //从安全组中删除权限 (zpc)
    @Override
    public boolean removeSecurityPermissionFromSecurityGroup(String permissionId, String groupId) {
        return securityGroupPermissionDAO.removeSecurityPermissionFromSecurityGroup(permissionId,groupId);
        //return true;
    }

    public SecurityGroupPermissionDAO getSecurityGroupPermissionDAO() {
        return securityGroupPermissionDAO;
    }

    public void setSecurityGroupPermissionDAO(SecurityGroupPermissionDAO securityGroupPermissionDAO) {
        this.securityGroupPermissionDAO = securityGroupPermissionDAO;
    }
}
